﻿using DimensionsHelper.Common.Utils;
using DimensionsHelper.LanguageService.Syntax;

namespace DimensionsHelper.LanguageService.Symbols;

/// <summary>
///     元数据符号的基类。
/// </summary>
/// <param name="kind">元数据类型</param>
public abstract class MetadataSymbol(SymbolKinds kind, IDeclaration declaration)
    : AbstractSymbol(kind)
{
    public override bool IsMetadata => true;

    public override bool CanMakeArray => false;

    public virtual IDeclaration Declaration { get; } = declaration;

    public override bool Redeclare(ISymbol symbol)
    {
        symbol.GetLocations().ForEach(loc => LocationMap.AddLocation(loc));
        return true;
    }
}